home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / anwendungen / gw print / structurebrowser_v1.3 / sources / sbrequest.c < prev    next >
C/C++ Source or Header  |  1994-05-20  |  4KB  |  144 lines

  1. /*
  2.    Handles Intuition Requester structure
  3. */
  4.  
  5. #include "header/sb.h"
  6.  
  7. extern int level;         /* recursion level */
  8.  
  9.  
  10. /* PrRequester
  11.  
  12.    Put up the first page of data for a Requester structure.
  13. */
  14.  
  15. PrRequester (string, requester)
  16. char *string;
  17. struct Requester *requester;
  18. {
  19. static struct StructData structdata[] = {
  20.    { " OlderRequest",   "struct Requester *",   PRPTR,   PTRSIZE      },
  21.    { "-LeftEdge",       "SHORT",                PRINT,   INTSIZE      },
  22.    { "-TopEdge",        "SHORT",                PRINT,   INTSIZE      },
  23.    { "-Width",          "SHORT",                PRINT,   INTSIZE      },
  24.    { "-Height",         "SHORT",                PRINT,   INTSIZE      },
  25.    { "-RelLeft",        "SHORT",                PRINT,   INTSIZE      },
  26.    { "-RelTop",         "SHORT",                PRINT,   INTSIZE      },
  27.    { " ReqGadget",      "struct Gadget *",      PRPTR,   PTRSIZE      },
  28.    { " ReqBorder",      "struct Border *",      PRPTR,   PTRSIZE      },
  29.    { " ReqText",        "struct IntuiText *",   PRPTR,   PTRSIZE      },
  30.    { " Flags",          "USHORT",               PRUINT,  INTSIZE      },
  31.    { "-BackFill",       "UBYTE",                PRUBYTE, BYTESIZE     },
  32.    { "-(padding)",      "UBYTE",                PRUBYTE, BYTESIZE     },
  33.    { " ReqLayer",       "struct Layer *",       PRPTR,   PTRSIZE      },
  34.    { " ReqPad1[32]",    "UBYTE",                PRNULL,  BYTESIZE * 32},
  35.    { " ImageBMap",      "struct BitMap *",      PRPTR,   PTRSIZE      }
  36. };
  37.  
  38. static char *flagnames[16] = {
  39.    "POINTREL",       "PREDRAWN",      "NOISYREQ",       NULL,
  40.    NULL,             NULL,            NULL,             NULL,
  41.    NULL,             NULL,            NULL,             NULL,
  42.    "REQOFFWINDOW",   "REQACTIVE",     "SYSREQUEST",     "DEFERREFRESH"
  43. };
  44.  
  45. int i, sum;
  46. int choice = -1;
  47.  
  48.    level++;
  49.  
  50.    while (choice)
  51.    {
  52.       sum = SetOptionText(string, structdata, (APTR)requester, DATASIZE, 0);
  53.  
  54.       switch (choice = GetChoice(MAXGADG + 1))
  55.       {
  56.          case 1:
  57.             if (requester->OlderRequest)
  58.                PrRequester("The Requester rendered before this one",
  59.                   requester->OlderRequest);
  60.             break;
  61.          case 8:
  62.             if (requester->ReqGadget)
  63.                PrGadget("The first Gadget for this Requester",
  64.                   requester->ReqGadget);
  65.             break;
  66.          case 9:
  67.             if (requester->ReqBorder)
  68.                PrBorder("The Border structure for this Requester",
  69.                   requester->ReqBorder);
  70.             break;
  71.          case 10:
  72.             if (requester->ReqText)
  73.                PrIText("The IntuiText structure for this Requester's text",
  74.                   requester->ReqText);
  75.             break;
  76.          case 11:
  77.             FlagPrint("Flags set for this Requester",
  78.                   flagnames, (ULONG)requester->Flags);
  79.             break;
  80.          case 14:
  81.             if (requester->ReqLayer)
  82.                PrLayer("The Layer for this Requester", requester->ReqLayer);
  83.             break;
  84.          case 15:
  85.             HexDump("Hexdump of this Requester's pad bytes (group 1)",
  86.                &requester->ReqPad1[0], BYTESIZE, (long)BYTESIZE * 32);
  87.             break;
  88.          case 16:
  89.             if (requester->ImageBMap)
  90.                PrBitMap("Custom BitMap structure for this Requester",
  91.                      requester->ImageBMap);
  92.             break;
  93.          case MOREGADG:
  94.             PrRequester2("Requester members (page 2)", requester, sum);
  95.             break;
  96.       }
  97.    }
  98.    level--;
  99. }
  100.  
  101.  
  102. /* PrReq2
  103.  
  104.    Put up the second page of data for a Requester structure.
  105. */
  106.  
  107. PrRequester2 (string, requester, offset)
  108. char *string;
  109. struct Requester *requester;
  110. int offset;
  111. {
  112. static struct StructData structdata[] = {
  113.    { " RWindow",        "struct Window *",      PRPTR,      PTRSIZE      },
  114.    { " ReqPad2[36]",    "UBYTE",                PRNULL,     BYTESIZE * 36}
  115. };
  116.  
  117. int i, sum;
  118. int choice = -1;
  119.  
  120.    level++;
  121.  
  122.    while (choice)
  123.    {
  124.       sum = SetOptionText(string, structdata,
  125.             (APTR)requester, DATASIZE, offset);
  126.  
  127.       switch (choice = GetChoice(DATASIZE))
  128.       {
  129.          case 1:
  130.             if (requester->RWindow)
  131.                PrWindow("This Requester's Window",
  132.                   requester->RWindow);
  133.             break;
  134.          case 2:
  135.             HexDump("Hexdump of this Requester's pad bytes (group 2)",
  136.                &requester->ReqPad2[0], BYTESIZE, (long)BYTESIZE * 36);
  137.             break;
  138.       }
  139.    }
  140.    level--;
  141. }
  142.  
  143.  
  144.